﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using System.Diagnostics;

namespace WDA.Config.Database
{
	internal sealed class Configuration : IConfiguration
	{
		#region Members
		private readonly int _id;
		private readonly string _name;
		private readonly long _version;
		private readonly ReadOnlyCollection<IHost> _hosts;	
		#endregion

		internal Configuration(int id, string name, long version, List<IHost> hosts)
		{
			_id = id;
			_name = name;
			_version = version;
			if (hosts != null)
			{
				_hosts = hosts.AsReadOnly();
			}
		}

		#region IConfiguration Members
		public long Version
		{
         [DebuggerStepThrough]
			get { return _version; }
		}

		public string Name
		{
         [DebuggerStepThrough]
			get { return _name; }
		}

		public IEnumerable<IHost> Hosts
		{
         [DebuggerStepThrough]
			get { return _hosts; }
		}
		#endregion
	}
}
